<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    
    <title>增加管理员</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link class="bootstrap library" rel="stylesheet" type="text/css" href="<c:url value="/css/bootstrap.min.css"/>">
	<script src="js/jquery-1.2.6.min.js" type=text/javascript></script>
	<script src="js/formValidator.js" type="text/javascript" charset="UTF-8"></script>
	<script src="js/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>
	<script type="text/javascript">
	$(document).ready(function(){
		$.formValidator.initConfig({formid:"form1",debug:false,submitonce:true,
			onerror:function(msg,obj,errorlist){
				//$.map(errorlist,function(msg1){alert(msg1)});
				alert(msg);
			}
		});
		/*只可为数字或字母*/
		$("#t_UserName").formValidator({onshow:"5-10个字符",onfocus:"5-10个字符",oncorrect:"该用户名可以注册"})
		.inputValidator({min:5,max:10,onerror:"输入有误"})
		.regexValidator({regexp:"username",datatype:"enum",onerror:"格式有误"});
		
		
	 /*   $("#t_UserName").formValidator({onshow:"至少2个中文",onfocus:"至少2个中文",oncorrect:"通过"})
		.inputValidator({min:4,max:10,empty:{
		leftempty:false,rightempty:false,emptyerror:"输入有误"},onerror:"输入有误"});
		*/
		$("#t_UserPass").formValidator({onshow:"至少6个字符",onfocus:"至少6个字符",oncorrect:"密码合法"})
		.inputValidator({min:6,empty:{
		leftempty:false,rightempty:false,emptyerror:"输入有误"},onerror:"输入有误"});
		$("#t_RePass").formValidator({onshow:"请再次输入密码",onfocus:"请再次输入密码",oncorrect:"密码一致"})
		.inputValidator({min:6,empty:{
		leftempty:false,rightempty:false,emptyerror:"输入有误"},onerror:"输入有误"})
		.compareValidator({desid:"t_UserPass",operateor:"=",onerror:"密码不一致"});	
		$("#iptName").formValidator({onshow:"至少4个字符",onfocus:"至少4个字符",oncorrect:"通过"})
		.inputValidator({min:4,empty:{
		leftempty:false,rightempty:false,emptyerror:"输入有误"},onerror:"输入有误"});
		$("#iptCard").formValidator({onshow:"15或18位的身份证",onfocus:"15或18位的身份证",oncorrect:"输入正确"}).functionValidator({fun:isCardID});
		$("#t_Email").formValidator({
		onshow:"6-100个字符",onfocus:"6-100个字符",oncorrect:"恭喜你,你输对了",defaultvalue:""})
		.inputValidator({min:6,max:100,onerror:"长度非法"}).
		regexValidator({regexp:"^([\\w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([\\w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$"
		,onerror:"格式不正确"});
		$("#Phone").formValidator({empty:false,onshow:"请输入你的联系电话",
		onfocus:"如：0577-88888888",oncorrect:"谢谢你的合作",onempty:"电话不能为空"})
		.regexValidator({regexp:"^[[0-9]{3}-|\[0-9]{4}-]?([0-9]{8}|[0-9]{7})?$",
		onerror:"格式不正确"});
	    $("#ZipCode").formValidator({onshow:"请输入邮编",onfocus:"例如:325000",oncorrect:"邮编正确"})
	    .regexValidator({regexp:"zipcode",datatype:"enum",onerror:"邮编格式不正确"});
		$("#Address").formValidator({onshow:"输入地址",onfocus:"至少2个字符",oncorrect:"通过"})
		.inputValidator({min:4,max:10,empty:{
		leftempty:false,rightempty:false,emptyerror:"输入有误"},onerror:"输入有误"});
		$("#Birthday").formValidator({empty:false,onshow:"请输入你的生日",
		onfocus:"形如 :2003-12-10",oncorrect:"谢谢你的合作",onempty:"生日不能为空"})
		.regexValidator({regexp:"^([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8])))$",
		onerror:"格式不正确"});
});
	

</script>									
	<style>
      *{margin:0;padding: 0;}
       body{background: #444 url(img/carbon_fibre_big.png)}
      .loginBox{width:400px;height:450px;padding:0 20px;border:1px solid #fff; color:#000; margin-top:40px;
        border-radius:8px;background: white;box-shadow:0 0 15px #222;
     /* background: -moz-linear-gradient(top, #fff, #efefef 8%);
        background: -webkit-gradient(linear, 0 0, 0 100%, from(#f6f6f6), to(#f4f4f4));
       */
        font:11px/1.5em 'Microsoft YaHei' ;position: absolute;left:50%;top:35%;margin-left:-210px;margin-top:-115px;
        
        }
      .loginBox h2{height:45px;font-size:20px;font-weight:normal;}
      .loginBox .left{#ccc;height:100%;padding-right: 20px; }
      
      .content_form{margin-top:30px;}
      .onShow,.onFocus,.onError,.onCorrect,.onLoad{
         background:url(img/reg_bg.png) no-repeat 3000px 3000px;
         padding-left:30px; 
         font-size: 12px; 
         height:25px; 
         width:124px; 
         display:inline-block; 
         line-height:25px; 
         vertical-align:middle; 
         overflow:hidden; 
         margin-left:6px;
         margin-bottom:8px}
	  .onShow{color:#999; padding-left:0px}
	  .onFocus{background-position:0px -30px; color:#333}
	  .onError{background-position:0px -60px; color:#333}
	  .onCorrect{background-position:0px 0; text-indent:-9000px}
	  .onLoad{background-position:0px 0}
      #t_UserName,#t_UserPass,#t_RePass,#iptName,#t_Email,#Address,#Phone,#ZipCode,#Birthday{
       font-size:13px;
       height:24px;
      }
      
      </style>

  </head>
  
  <body>
  	
      <hr/>
      <div class="wrapper">
       <section class="loginBox row-fluid">
          <section class="span7 left">
           <div class="title">
          <center><h3>添加管理员</h3></center>
      </div>
          <form name="form1" id="form1" class="content_form" action="<c:url value='/managerMgr' />" method="post" >
              <input type="hidden" name="act" value="add"/>
              <div class="wrapper_div" >
                  <span >用户账号:</span>
                  <input type="text" style="width:160" name="manager_name" id="t_UserName" />
                  <span id="t_UserNameTip" class="onshow" style="width:130"></span>
              </div>
              <div class="wrapper_div">
                  <span>输入密码:</span>
                  <input type="password" style="width: 160" name="manager_pwd" id="t_UserPass"/>
             	  <span id="t_UserPassTip" class="onshow"></span>
              </div>
              <div class="wrapper_div">
                  <span>确认密码:</span>
                  <input type="password" style="width: 160" name="manager_pwd" id="t_RePass"/>
              	  <span id="t_RePassTip" class="onshow"></span>
              </div>
              <div class="wrapper_div">
                  <span>真实姓名:</span>
                  <input type="text" style="width: 160" name="manager_rel_name" id="iptName"/>
              	  <span id="iptNameTip" class="onshow"></span>
              </div>
              <div class="wrapper_div">
                  <span>性别:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</span>
                   男<input type="radio" name="manager_sex"  checked="CHECKED" value="0"/>
                   女<input type="radio" name="manager_sex" value="1"/>
              </div>
              <div class="wrapper_div">
                  <span>出生日期:</span>
                  <input type="text"  style="width: 160" name="manager_birthday" id="Birthday"/>
            	  <span id="BirthdayTip" class="onshow"></span>
              </div>
              <div class="wrapper_div">
                  <span>电子邮箱:</span>
                  <input type="text" style="width: 160" name="manager_email" id="t_Email"/>
             	  <span id="t_EmailTip" class="onshow"></span>
              </div>
              <div class="wrapper_div">
                  <span>居住地址:</span>
                  <input type="text" style="width: 160" name="manager_addr" id="Address" />
                  <span id="AddressTip" class="onshow"></span>
              </div>
              <div class="wrapper_div">
                  <span>联系电话:</span>
                  <input type="text" style="width: 160" name="manager_phone" id="Phone"/>
              	  <span id="PhoneTip" class="onshow"></span>
              </div>
              <div class="wrapper_div">
                  <span>邮编:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</span>
                  <input type="text" style="width: 160" name="manager_zipcode" id="ZipCode" />
					<span id="ZipCodeTip" class="onshow"></span>
              </div>
              <div class="wrapper_div">
                  <input id="button" name="button" type="submit" value="提交" class="btn btn-primary"/> 
                  <input type="reset" value="重置" class="btn btn-primary"/>
              </div>
          </form>
          </section>
        </section>
      </div>
  </body>
</html>
